//
//  GDChooseControllerOperation.m
//  GraduationDesign
//
//  Created by JiaKang.Zhong on 16/1/3.
//  Copyright © 2016年 JiaKang.Zhong. All rights reserved.
//

#import "GDChooseControllerOperation.h"
#import "GDMainHomeController.h"
#import "GDNewFetureController.h"

#define GDVersion @"version"
@implementation GDChooseControllerOperation

+(void)chooseController:(UIWindow *)window{
  
    NSUserDefaults * userDefault = [NSUserDefaults standardUserDefaults];
    NSString * oldVersion = [userDefault objectForKey:GDVersion];
    NSString * currVersion = [NSBundle mainBundle].infoDictionary[@"CFBundleShortVersionString"];
    if ([oldVersion isEqualToString:currVersion]) {
        //不进入新特性,直接进入主页面
        GDMainHomeController * mainHomeController = [[GDMainHomeController alloc] init];
        window.rootViewController = mainHomeController;
    }else {
        //保存版本信息
        [userDefault setObject:currVersion forKey:GDVersion];
        
        //进入新特性
//        GDNewFetureController * newFuture = [[GDNewFetureController alloc] init];
//        window.rootViewController = newFuture;
  
    }
}
@end
